﻿@using System.Threading.Tasks
@using MVlog.Authorization
@using MVlog.Web.Areas.AppAreaName.Startup
@model MVlog.Web.Areas.AppAreaName.Models.Languages.LanguagesIndexViewModel
@{
    ViewBag.CurrentPageName = AppAreaNamePageNames.Common.Languages;
}
@section Styles
{
    <environment names="Development">
        <link rel="stylesheet" href="~/view-resources/Areas/AppAreaName/Views/Languages/Index.css" asp-append-version="true" />
    </environment>

    <environment names="Staging,Production">
        <link rel="stylesheet" href="~/view-resources/Areas/AppAreaName/Views/Languages/Index.min.css" asp-append-version="true" />
    </environment>
}
@section Scripts
{
    <environment names="Development">
        <script src="~/view-resources/Areas/AppAreaName/Views/Languages/_CreateOrEditModal.js" asp-append-version="true"></script>
        <script src="~/view-resources/Areas/AppAreaName/Views/Languages/Index.js" asp-append-version="true"></script>
    </environment>

    <environment names="Staging,Production">
        <script src="~/view-resources/Areas/AppAreaName/Views/Languages/_CreateOrEditModal.min.js" asp-append-version="true"></script>
        <script src="~/view-resources/Areas/AppAreaName/Views/Languages/Index.min.js" asp-append-version="true"></script>
    </environment>
}
<div class="row margin-bottom-5">
    <div class="col-xs-6">
        <div class="page-head">
            <div class="page-title">
                <h1>
                    <span>@L("Languages")</span> <small>@L("LanguagesHeaderInfo")</small>
                </h1>
            </div>
        </div>
    </div>
    <div class="col-xs-6 text-right">
        @if (IsGranted(AppPermissions.Pages_Administration_Languages_Create))
        {
            <button id="CreateNewLanguageButton" class="btn btn-primary blue"><i class="fa fa-plus"></i> @L("CreateNewLanguage")</button>
        }
    </div>
</div>

<div class="portlet light margin-bottom-0">
    <div class="portlet-body">
        <table id="LanguagesTable" class="display table table-striped table-bordered table-hover dt-responsive nowrap">
            <thead>
            <tr>
                <th>@L("Actions")</th>
                <th>@L("Name")</th>
                <th>@L("Code")</th>
                <th>@L("Default")</th>
                <th>@L("CreationTime")</th>
                <th>@L("IsEnabled")</th>
            </tr>
            </thead>
        </table>
        @if (Model.IsTenantView)
        {
            <p class="margin-top-20">
                @("* " + L("CanNotEditOrDeleteDefaultLanguages"))
            </p>
        }
    </div>
</div>
